import { modifyRecord, showMsg } from '../../../vuex/action'

export default {
  name: 'modifyRecord',
  data() {
    return {
      customerId: '',
      list: []
    }
  },
  vuex: {
    actions: {
      xShowMsg: showMsg,
      xModifyRecord: modifyRecord
    }
  },
  ready() {
    this.customerId = this.$route.params.id
    this.search()
  },
  methods: {
    search() {
      this.xModifyRecord({
        customerId: this.customerId
      })
        .then((data) => {
          this.list = data.list
        })
        .catch((res) => {
          this.xShowMsg({
            type: 'danger',
            content: res.error_msg
          })
        })
    }
  }
}
